<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>社交活动平台 - 会员中心</title>
    <style>
        /* 重置样式 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
            background-color: #f5f7fa;
            color: #333;
            line-height: 1.6;
        }

        /* 容器样式 */
        .container {
            max-width: 480px;
            margin: 0 auto;
            background-color: #fff;
            min-height: 100vh;
        }

        /* 头部导航 */
        .header {
            position: sticky;
            top: 0;
            background-color: white;
            padding: 16px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            z-index: 100;
        }

        .header-content {
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .back-btn {
            background: none;
            border: none;
            font-size: 24px;
            cursor: pointer;
            color: #333;
        }

        .header-title {
            font-size: 18px;
            font-weight: bold;
            flex-grow: 1;
            text-align: center;
        }

        .action-btn {
            background: none;
            border: none;
            font-size: 20px;
            cursor: pointer;
            color: #333;
        }

        /* 会员卡片 */
        .membership-card {
            padding: 24px 16px;
            text-align: center;
            background: linear-gradient(135deg, #ff6b35 0%, #f9a825 100%);
            color: white;
            position: relative;
            overflow: hidden;
        }

        .membership-card::before {
            content: "";
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
            transform: rotate(30deg);
        }

        .membership-badge {
            position: absolute;
            top: 16px;
            right: 16px;
            background-color: rgba(255, 255, 255, 0.2);
            color: white;
            padding: 4px 12px;
            border-radius: 12px;
            font-size: 12px;
        }

        .membership-avatar {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            background-color: rgba(255, 255, 255, 0.2);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 40px;
            margin: 0 auto 16px;
            border: 3px solid rgba(255, 255, 255, 0.3);
        }

        .membership-name {
            font-size: 24px;
            font-weight: bold;
            margin-bottom: 4px;
        }

        .membership-id {
            font-size: 14px;
            opacity: 0.9;
            margin-bottom: 16px;
        }

        .membership-level {
            background-color: rgba(255, 255, 255, 0.2);
            padding: 6px 16px;
            border-radius: 20px;
            font-size: 14px;
            display: inline-block;
            margin-bottom: 20px;
        }

        .membership-expiry {
            font-size: 14px;
            opacity: 0.9;
        }

        /* 会员权益 */
        .benefits-section {
            padding: 20px 16px;
        }

        .section-title {
            font-size: 18px;
            font-weight: bold;
            margin-bottom: 20px;
            text-align: center;
        }

        .benefits-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 16px;
        }

        .benefit-card {
            background-color: #f9f9f9;
            border-radius: 16px;
            padding: 20px 16px;
            text-align: center;
            transition: all 0.3s ease;
            cursor: pointer;
        }

        .benefit-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
        }

        .benefit-icon {
            font-size: 32px;
            margin-bottom: 12px;
        }

        .benefit-title {
            font-size: 14px;
            font-weight: bold;
            margin-bottom: 6px;
        }

        .benefit-description {
            font-size: 12px;
            color: #666;
        }

        /* 会员等级 */
        .level-section {
            padding: 16px;
            margin-bottom: 20px;
        }

        .level-container {
            background-color: #f9f9f9;
            border-radius: 16px;
            padding: 20px;
        }

        .level-title {
            text-align: center;
            font-size: 18px;
            font-weight: bold;
            margin-bottom: 20px;
        }

        .level-progress {
            height: 8px;
            background-color: #e0e0e0;
            border-radius: 4px;
            margin-bottom: 16px;
            overflow: hidden;
        }

        .level-progress-bar {
            height: 100%;
            background: linear-gradient(90deg, #ff6b35 0%, #f9a825 100%);
            border-radius: 4px;
        }

        .level-stats {
            display: flex;
            justify-content: space-between;
            font-size: 12px;
            color: #666;
        }

        .level-info {
            display: flex;
            justify-content: space-between;
            margin-top: 20px;
        }

        .level-item {
            text-align: center;
        }

        .level-value {
            font-size: 16px;
            font-weight: bold;
            color: #ff6b35;
        }

        .level-label {
            font-size: 12px;
            color: #666;
        }

        /* 会员套餐 */
        .plans-section {
            padding: 16px;
        }

        .plan-title {
            font-size: 18px;
            font-weight: bold;
            margin-bottom: 20px;
            text-align: center;
        }

        .plans-grid {
            display: grid;
            gap: 16px;
        }

        .plan-card {
            background-color: #f9f9f9;
            border-radius: 16px;
            padding: 20px;
            position: relative;
            overflow: hidden;
            border: 2px solid transparent;
        }

        .plan-card.popular {
            border-color: #ff6b35;
            background-color: linear-gradient(135deg, #fff9f0 0%, #fff2e6 100%);
        }

        .plan-card.popular::before {
            content: "热门";
            position: absolute;
            top: 10px;
            right: -30px;
            background-color: #ff6b35;
            color: white;
            padding: 4px 20px;
            transform: rotate(45deg);
            font-size: 12px;
            font-weight: bold;
        }

        .plan-header {
            text-align: center;
            margin-bottom: 20px;
        }

        .plan-name {
            font-size: 18px;
            font-weight: bold;
            margin-bottom: 8px;
        }

        .plan-price {
            font-size: 24px;
            font-weight: bold;
            color: #ff6b35;
            margin-bottom: 4px;
        }

        .plan-period {
            font-size: 12px;
            color: #666;
        }

        .plan-features {
            list-style: none;
            margin-bottom: 20px;
        }

        .plan-features li {
            padding: 8px 0;
            font-size: 14px;
            display: flex;
            align-items: center;
        }

        .plan-features li::before {
            content: "✓";
            color: #4caf50;
            font-weight: bold;
            margin-right: 8px;
        }

        .plan-button {
            width: 100%;
            padding: 12px;
            border-radius: 8px;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
            border: none;
        }

        .plan-button:not(.popular) {
            background-color: #e0e0e0;
            color: #666;
        }

        .plan-button.popular {
            background: linear-gradient(135deg, #ff6b35 0%, #f9a825 100%);
            color: white;
        }

        .plan-button:hover:not(.popular) {
            background-color: #d0d0d0;
        }

        .plan-button:hover.popular {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
        }

        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background-color: white;
            border-top: 1px solid #eee;
            display: flex;
            justify-content: space-around;
            padding: 12px 0;
            z-index: 100;
        }

        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            color: #9e9e9e;
            font-size: 12px;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .nav-item.active {
            color: #ff6b35;
        }

        .nav-icon {
            font-size: 20px;
            margin-bottom: 4px;
        }

        /* 加载动画 */
        .loading {
            text-align: center;
            padding: 40px 20px;
        }

        .spinner {
            width: 36px;
            height: 36px;
            border: 4px solid #f3f3f3;
            border-top: 4px solid #ff6b35;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto 20px;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* 弹窗样式 */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            justify-content: center;
            align-items: center;
        }

        .modal-content {
            background-color: white;
            border-radius: 16px;
            width: 85%;
            max-width: 320px;
            padding: 24px;
            text-align: center;
            transform: translateY(20px);
            opacity: 0;
            transition: all 0.3s ease;
        }

        .modal.show {
            transform: translateY(0);
            opacity: 1;
        }

        .modal-title {
            font-size: 20px;
            font-weight: bold;
            margin-bottom: 16px;
            color: #333;
        }

        .modal-message {
            margin-bottom: 24px;
            color: #666;
            line-height: 1.6;
        }

        .modal-actions {
            display: flex;
            gap: 12px;
        }

        .modal-btn {
            flex: 1;
            padding: 12px;
            border-radius: 8px;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .cancel-btn {
            background-color: #f5f5f5;
            color: #666;
        }

        .confirm-btn {
            background: linear-gradient(135deg, #ff6b35 0%, #f9a825 100%);
            color: white;
        }

        /* 响应式适配 */
        @media (max-width: 480px) {
            .header-content {
                padding-top: 4px;
            }
            
            .benefits-grid {
                grid-template-columns: 1fr;
            }
            
            .plan-card.popular::before {
                right: -20px;
                padding: 3px 15px;
                font-size: 10px;
            }
        }

        /* 动画效果 */
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .benefit-card, .plan-card {
            animation: fadeInUp 0.6s ease forwards;
        }

        /* 按钮状态动画 */
        .plan-button {
            animation: pulse 2s infinite;
        }

        @keyframes pulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.02); }
            100% { transform: scale(1); }
        }

        /* 等级标签样式 */
        .level-tag {
            padding: 4px 12px;
            border-radius: 12px;
            font-size: 12px;
            font-weight: bold;
        }

        .tag-basic { background-color: #e3f2fd; color: #1976d2; }
        .tag-premium { background-color: #f3e5f5; color: #7b1fa2; }
        .tag-vip { background-color: #fff3e0; color: #f57c00; }
        .tag-gold { background-color: #fff8e1; color: #ff8f00; }

        /* 会员等级图标 */
        .level-icon {
            font-size: 24px;
            margin-bottom: 8px;
        }
    </style>
</head>
<body>
    <div class="container">
        <!-- 头部导航 -->
        <header class="header">
            <div class="header-content">
                <button class="back-btn" id="backBtn">←</button>
                <div class="header-title">会员中心</div>
                <button class="action-btn" id="helpBtn">?</button>
            </div>
        </header>

        <!-- 会员卡片 -->
        <div class="membership-card">
            <div class="membership-badge">VIP</div>
            <div class="membership-avatar">👤</div>
            <h1 class="membership-name">张小明</h1>
            <div class="membership-id">ID: 123456789</div>
            <div class="membership-level">黄金会员</div>
            <div class="membership-expiry">有效期至: 2024年12月31日</div>
        </div>

        <!-- 会员权益 -->
        <div class="benefits-section">
            <h2 class="section-title">会员专属权益</h2>
            <div class="benefits-grid">
                <div class="benefit-card" data-benefit="noAds">
                    <div class="benefit-icon">🚫</div>
                    <div class="benefit-title">无广告体验</div>
                    <div class="benefit-description">享受纯净的社交环境</div>
                </div>
                
                <div class="benefit-card" data-benefit="priority">
                    <div class="benefit-icon">⭐</div>
                    <div class="benefit-title">优先参与权</div>
                    <div class="benefit-description">热门活动优先报名资格</div>
                </div>
                
                <div class="benefit-card" data-benefit="filter">
                    <div class="benefit-icon">🔍</div>
                    <div class="benefit-title">高级筛选</div>
                    <div class="benefit-description">精准匹配感兴趣内容</div>
                </div>
                
                <div class="benefit-card" data-benefit="exclusive">
                    <div class="benefit-icon">🎁</div>
                    <div class="benefit-title">专属活动</div>
                    <div class="benefit-description">VIP专享主题活动</div>
                </div>
            </div>
        </div>

        <!-- 会员等级 -->
        <div class="level-section">
            <h2 class="section-title">会员成长等级</h2>
            <div class="level-container">
                <div class="level-title">当前等级：黄金会员</div>
                
                <div class="level-progress">
                    <div class="level-progress-bar" style="width: 75%"></div>
                </div>
                
                <div class="level-stats">
                    <span>基础会员</span>
                    <span>黄金会员</span>
                </div>
                
                <div class="level-info">
                    <div class="level-item">
                        <div class="level-value">1200</div>
                        <div class="level-label">成长值</div>
                    </div>
                    <div class="level-item">
                        <div class="level-value">240</div>
                        <div class="level-label">距离下一等级</div>
                    </div>
                </div>
            </div>
        </div>

        <!-- 会员套餐 -->
        <div class="plans-section">
            <h2 class="plan-title">会员套餐</h2>
            <div class="plans-grid">
                <!-- 基础版 -->
                <div class="plan-card" data-plan="basic">
                    <div class="plan-header">
                        <div class="plan-name">基础会员</div>
                        <div class="plan-price">¥9.9</div>
                        <div class="plan-period">/月</div>
                    </div>
                    
                    <ul class="plan-features">
                        <li>基础功能使用</li>
                        <li>普通活动参与</li>
                        <li>基本社交功能</li>
                    </ul>
                    
                    <button class="plan-button">立即开通</button>
                </div>
                
                <!-- 高级版 -->
                <div class="plan-card popular" data-plan="premium">
                    <div class="plan-header">
                        <div class="plan-name">高级会员</div>
                        <div class="plan-price">¥29.9</div>
                        <div class="plan-period">/月</div>
                    </div>
                    
                    <ul class="plan-features">
                        <li>无广告体验</li>
                        <li>优先参与热门活动</li>
                        <li>高级筛选功能</li>
                        <li>专属客服支持</li>
                    </ul>
                    
                    <button class="plan-button popular">立即升级</button>
                </div>
                
                <!-- 黄金版 -->
                <div class="plan-card" data-plan="gold">
                    <div class="plan-header">
                        <div class="plan-name">黄金会员</div>
                        <div class="plan-price">¥59.9</div>
                        <div class="plan-period">/月</div>
                    </div>
                    
                    <ul class="plan-features">
                        <li>所有高级功能</li>
                        <li>专属活动优先权</li>
                        <li>私人定制推荐</li>
                        <li>专属客服服务</li>
                        <li>活动发起次数提升</li>
                    </ul>
                    
                    <button class="plan-button">立即升级</button>
                </div>
            </div>
        </div>

        <!-- 底部导航 -->
        <nav class="bottom-nav">
            <div class="nav-item" data-page="home">
                <span class="nav-icon">🏠</span>
                <span>首页</span>
            </div>
            <div class="nav-item" data-page="search">
                <span class="nav-icon">🔍</span>
                <span>搜索</span>
            </div>
            <div class="nav-item" data-page="publish">
                <span class="nav-icon">➕</span>
                <span>发布</span>
            </div>
            <div class="nav-item active" data-page="profile">
                <span class="nav-icon">👤</span>
                <span>我的</span>
            </div>
        </nav>

        <!-- 帮助弹窗 -->
        <div class="modal" id="helpModal">
            <div class="modal-content">
                <h3 class="modal-title">会员权益说明</h3>
                <p class="modal-message">
                    会员等级分为基础、高级、黄金三个级别，不同等级享有不同的特权：<br><br>
                    • 基础会员：享受基本功能和普通社交体验<br>
                    • 高级会员：无广告、优先参与、高级筛选等特权<br>
                    • 黄金会员：所有高级功能+专属活动和客服支持
                </p>
                <div class="modal-actions">
                    <button class="modal-btn cancel-btn" id="closeHelpBtn">知道了</button>
                </div>
            </div>
        </div>

        <!-- 加载状态 -->
        <div class="loading" id="loadingIndicator">
            <div class="spinner"></div>
            <p>加载中...</p>
        </div>

        <!-- 通知 Toast -->
        <div id="toast" style="display: none; position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background-color: #4caf50; color: white; padding: 12px 24px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 1001;"></div>
    </div>

    <script>
        // 全局变量
        let currentPlan = null;
        let membershipData = {
            level: 'gold',
            name: '张小明',
            id: '123456789',
            expiryDate: '2024-12-31',
            points: 1200,
            nextLevelPoints: 240
        };

        // 初始化
        document.addEventListener('DOMContentLoaded', function() {
            initEventListeners();
            simulateLoading();
            
            // 模拟加载会员数据
            setTimeout(() => {
                updateMembershipDisplay();
            }, 1000);
        });

        // 初始化事件监听器
        function initEventListeners() {
            // 返回按钮
            document.getElementById('backBtn').addEventListener('click', function() {
                window.history.back();
            });

            // 帮助按钮
            document.getElementById('helpBtn').addEventListener('click', function() {
                const modal = document.getElementById('helpModal');
                modal.classList.add('show');
            });

            // 关闭帮助弹窗
            document.getElementById('closeHelpBtn').addEventListener('click', function() {
                const modal = document.getElementById('helpModal');
                modal.classList.remove('show');
            });

            // 帮助弹窗背景点击关闭
            document.getElementById('helpModal').addEventListener('click', function(e) {
                if (e.target === this) {
                    this.classList.remove('show');
                }
            });

            // 底部导航切换
            const navItems = document.querySelectorAll('.nav-item');
            navItems.forEach(item => {
                item.addEventListener('click', function() {
                    // 移除所有激活状态
                    navItems.forEach(i => i.classList.remove('active'));
                    // 添加当前激活状态
                    this.classList.add('active');
                    
                    const page = this.dataset.page;
                    handleNavigation(page);
                });
            });

            // 会员权益点击
            const benefitCards = document.querySelectorAll('.benefit-card');
            benefitCards.forEach(card => {
                card.addEventListener('click', function() {
                    const benefit = this.dataset.benefit;
                    handleBenefitClick(benefit);
                });
            });

            // 套餐按钮点击
            const planButtons = document.querySelectorAll('.plan-button');
            planButtons.forEach(button => {
                button.addEventListener('click', function() {
                    const plan = this.closest('.plan-card').dataset.plan;
                    handlePlanClick(plan);
                });
            });

            // 模拟会员数据更新
            setInterval(() => {
                updateMembershipDisplay();
            }, 30000); // 每30秒更新一次
        }

        // 处理权益点击
        function handleBenefitClick(benefit) {
            switch(benefit) {
                case 'noAds':
                    alert('无广告体验：享受纯净的社交环境，告别烦人的广告干扰');
                    break;
                case 'priority':
                    alert('优先参与权：热门活动享受优先报名资格，不错过任何精彩内容');
                    break;
                case 'filter':
                    alert('高级筛选：精准匹配您感兴趣的活动内容，提升使用效率');
                    break;
                case 'exclusive':
                    alert('专属活动：参与VIP专享主题活动，享受特别优惠和福利');
                    break;
            }
        }

        // 处理套餐点击
        function handlePlanClick(plan) {
            currentPlan = plan;
            
            switch(plan) {
                case 'basic':
                    alert('跳转到基础会员开通页面');
                    break;
                case 'premium':
                    showSuccessToast('正在为您升级到高级会员...');
                    setTimeout(() => {
                        updateMembershipDisplay();
                        showSuccessToast('恭喜您升级为高级会员！');
                    }, 1500);
                    break;
                case 'gold':
                    showSuccessToast('正在为您升级到黄金会员...');
                    setTimeout(() => {
                        updateMembershipDisplay();
                        showSuccessToast('恭喜您升级为黄金会员！');
                    }, 1500);
                    break;
            }
        }

        // 更新会员显示
        function updateMembershipDisplay() {
            // 更新等级显示
            const levelElement = document.querySelector('.membership-level');
            if (levelElement) {
                levelElement.textContent = getMembershipLevelText(membershipData.level);
            }
            
            // 更新成长值显示
            const pointsElement = document.querySelector('.level-value');
            if (pointsElement) {
                pointsElement.textContent = membershipData.points;
            }
            
            // 更新进度条
            const progressBars = document.querySelectorAll('.level-progress-bar');
            if (progressBars.length > 0) {
                const progressPercentage = Math.min(100, (membershipData.points / (membershipData.points + membershipData.nextLevelPoints)) * 100);
                progressBars[0].style.width = `${progressPercentage}%`;
            }
        }

        // 获取会员等级文本
        function getMembershipLevelText(level) {
            const levelMap = {
                'basic': '基础会员',
                'premium': '高级会员', 
                'gold': '黄金会员'
            };
            return levelMap[level] || '基础会员';
        }

        // 处理导航切换
        function handleNavigation(page) {
            switch(page) {
                case 'home':
                    alert('跳转到首页');
                    break;
                case 'search':
                    alert('跳转到搜索页面');
                    break;
                case 'publish':
                    alert('跳转到发布页面');
                    break;
                case 'profile':
                    // 个人中心无需特殊处理
                    break;
            }
        }

        // 显示加载状态
        function showLoading() {
            const loading = document.getElementById('loadingIndicator');
            loading.style.display = 'block';
        }

        // 隐藏加载状态
        function hideLoading() {
            const loading = document.getElementById('loadingIndicator');
            loading.style.display = 'none';
        }

        // 模拟加载效果
        function simulateLoading() {
            showLoading();
            setTimeout(() => {
                hideLoading();
            }, 1500);
        }

        // 显示成功提示
        function showSuccessToast(message) {
            const toast = document.getElementById('toast');
            toast.textContent = message;
            toast.style.display = 'block';
            
            // 3秒后自动隐藏
            setTimeout(() => {
                toast.style.display = 'none';
            }, 3000);
        }

        // 添加触摸反馈效果
        const buttons = document.querySelectorAll('button, .benefit-card');
        buttons.forEach(button => {
            button.addEventListener('touchstart', function() {
                this.style.transform = 'scale(0.95)';
            });
            
            button.addEventListener('touchend', function() {
                this.style.transform = 'scale(1)';
            });
        });

        // 添加页面滚动效果
        let lastScrollTop = 0;
        window.addEventListener('scroll', function() {
            const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
            
            // 隐藏/显示底部导航
            const bottomNav = document.querySelector('.bottom-nav');
            if (scrollTop > lastScrollTop && scrollTop > 100) {
                bottomNav.style.transform = 'translateY(100%)';
            } else {
                bottomNav.style.transform = 'translateY(0)';
            }
            
            lastScrollTop = scrollTop;
        });

        // 添加返回顶部功能
        window.addEventListener('scroll', function() {
            if (window.pageYOffset > 300) {
                // 可以添加返回顶部按钮
            }
        });
    </script>
</body>
</html>
